﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace zielonka.co.uk.extensions.system
{
    //Description:	Shortcut for System.String.Format
    /*
        string s = "999";
        int i = s.ToInt32();
    */

    public static partial class StringExtensions
    {
        // Calls the underlying int.TryParse method to convert a string
        // representation of a number to its 32-bit signed integer equivalent.
        // Returns Zero if conversion fails. 
        public static int ToInt32(this string s)
        {
            int retInt;
            int.TryParse(s, out retInt);
            return retInt;
        }
    }
}
